package com.dd.probe.web.service.impl;

import com.dd.probe.common.pojo.param.SSHConnParam;
import com.dd.probe.common.pojo.param.SSHProbeConfigParam;
import com.dd.probe.web.service.internalApi.ConfigService;
import com.dd.probe.web.util.ConfigConstants;
import com.dd.probe.web.util.SSHUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author liuxianmeng
 * @CreateTime 2024/12/22 13:20
 * @Description 类功能作用说明
 */
@Slf4j
@Service
public class ConfigServiceImpl implements ConfigService {

    @Override
    public Boolean configSSH(SSHProbeConfigParam param) {
        SSHUtil.configSSH(SSHConnParam.builder().IP("127.0.0.1").port(22).username(param.getUsername()).password(param.getPassword()).build());
        log.info("SSH配置参数为：" + param);
        return true;
    }

    @Override
    public Boolean configNetInterface(String interfaceName) {
        ConfigConstants.NET_INTERFACE_NAME = interfaceName;
        return true;
    }
}
